home *** CD-ROM | disk | FTP | other *** search
- //
- // $Id$
- //
- // Module : mfcvbx.h
- //
- // Author : James Bish
- //
- // Date : 06/15/93
- //
- // $Log$
- //
- // Copyright (c) Bish Programming 1993 - All Rights Reserved.
- //
-
- #include <afxwin.h>
- #include <afxcoll.h>
- #include <afxdlgs.h>
-
- #ifndef __MFCVBX_H__
- #define __MFCVBX_H__
-
- #include "vbxmsg.h"
-
- //
- // Class CVBCtlWnd
- //
- class CVBCtlWnd : public CWnd
- {
- DECLARE_DYNAMIC(CVBCtlWnd)
-
- public:
- HCTL m_hCtl;
-
- CVBCtlWnd();
- CVBCtlWnd(HWND hwnd);
- LRESULT DefWindowProc(UINT msg,WPARAM wp,LPARAM lp);
- void PostNcDestroy() {delete this;}
- afx_msg void OnSize(UINT nType, int cx, int cy);
-
- LRESULT WindowProc(USHORT msg,WPARAM wp,LPARAM lp)
- { return CWnd::WindowProc(msg,wp,lp); }
- protected:
- //
- // Functions for VBAPI Message Processing.
- //
-
- afx_msg void OnPaint();
-
- afx_msg LRESULT OnVBCancelMode(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBCheckProperty(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBCopy(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBCreated(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBDragDrop(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBDragOver(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBFireEvent(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBGetDefSize(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBGetPalette(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBGetProperty(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBGetPropertyHsz(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBHelp(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBHitTest(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBInitialize(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBInitPropPopup(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBIsMnemonic(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBLinkEnumFormats(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBLinkGetData(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBLinkGetItemName(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBLinkSetData(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBLoaded(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBLoadProperty(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBLoadTextProperty(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBMethod(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBMnemonic(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBPaint(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBPaintMultiSel(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBPaintOutline(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBPaletteChanged(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBPaste(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBQPasteOk(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBSaveProperty(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBSaveTextProperty(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBSetProperty(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBWantSpecialKey(WPARAM wp, LPARAM lp);
-
- afx_msg LRESULT OnVBCharToItem(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBCtlCommand(WPARAM wp, LPARAM lp); // CtlCommand instead of Command due to conflict with MFC
- afx_msg LRESULT OnVBCompareItem(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBCtlColor(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBDeleteItem(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBDrawItem(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBHScroll(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBMeasureItem(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBParentNotify(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBVKeyToItem(WPARAM wp, LPARAM lp);
- afx_msg LRESULT OnVBVScroll(WPARAM wp, LPARAM lp);
-
- DECLARE_MESSAGE_MAP()
- };
-
-
- //
- // Class to put a wrapper around the VBAPI PROPINFO structure.
- //
- class CVBCtlPropInfo : public CObject {
- public:
- // Constructors
-
- CVBCtlPropInfo(PROPINFO NEAR *StdProp);
-
- CVBCtlPropInfo(PSTR npszName, FLONG fl,
- BYTE offsetData, LONG dataDefault = -1, PSTR npszEnumList = NULL,
- BYTE enumMax = -1);
-
-
- ~CVBCtlPropInfo();
-
- // Operations
-
- PROPINFO NEAR *GetProperty() { return m_thePropInfo; }
- private:
- int m_allocated;
- PROPINFO NEAR *m_thePropInfo;
- };
-
- //
- // Class for a list of CVBCtlPropInfo objects.
-
- class CVBCtlPropInfoList : public CObList {
- };
-
- //
- // Class to put a wrapper around the VBAPI PEVENTINFO structure.
- //
- class CVBCtlEventInfo : public CObject {
- public:
- // Constructors
-
- CVBCtlEventInfo(EVENTINFO NEAR *StdEvent);
-
- CVBCtlEventInfo(PSTR npszName, USHORT cParams = 0,
- USHORT cwParams = 0, PWORD npParamTypes = NULL,
- PSTR npszParamProf = NULL,
- FLONG fl = 0L);
-
- ~CVBCtlEventInfo();
-
- // Operations
-
- EVENTINFO NEAR *GetEvent() { return m_theEventInfo; }
-
- private:
- int m_allocated;
- EVENTINFO NEAR *m_theEventInfo;
- };
-
- //
- // Class to create a list of CVBCtlPEventInfo objects.
- //
- class CVBCtlEventInfoList : public CObList {
- };
-
- //
- // Class to put a wrapper around the VBAPI MODEL structure.
- //
-
- class CVBCtlModel : public CObject {
- public:
- // Constructors
-
- CVBCtlModel(USHORT usVersion, FLONG fl, PCTLPROC pctlproc,
- FSHORT fsCalssStyle, FLONG flWndStyle, USHORT cbCtlExtra,
- USHORT idBmpPalette, PSTR npszDefCtlName, PSTR npszDefClassName,
- PSTR npszParentClassName,
- BYTE nDefProp, BYTE npDefEvent,
- BYTE nValueProp, CRuntimeClass *theclass);
-
- CVBCtlModel(USHORT usVersion, FLONG fl, PCTLPROC pctlproc,
- FSHORT fsCalssStyle, FLONG flWndStyle, USHORT cbCtlExtra,
- USHORT idBmpPalette, PSTR npszDefCtlName, PSTR npszDefClassName,
- CRuntimeClass *theclass);
-
- ~CVBCtlModel();
-
- void SetParentWindowClass(char *ParentWindowClass = NULL);
- void SetDefProp(BYTE nDefProp = -1, BYTE nValueProp = -1);
- void SetDefEvent(BYTE nDefEvent = -1);
-
- char *GetParentWindowClass();
- BYTE GetDefProp();
- BYTE GetDefEvent();
-
- void SetCtlModelProc() { }
- MODEL *GetCtlModel() { return m_Model; }
- MODEL *GetCtlModel(char *CtlName)
- { return m_Model; }
-
- CRuntimeClass *GetCtlClass() { return &m_Class; }
- void SetCtlClass(CRuntimeClass theclass)
- { m_Class = theclass; }
-
- //
- // Functions to Handle the sublists.
- //
-
- void AddProperty(PROPINFO NEAR *StdProp);
-
- void AddProperty(PSTR npszName, FLONG fl,
- BYTE offsetData, LONG dataDefault = -1, PSTR npszEnumList = NULL,
- BYTE enumMax = -1);
-
- void AddEvent(EVENTINFO NEAR *StdEvent);
-
- void AddEvent(PSTR npszName, USHORT cParams = 0,
- USHORT cwParms = 0, PWORD npParmTypes = NULL, PSTR
- npszParmProf = NULL,
- FLONG fl = 0L );
-
- void SetProperties();
- void SetEvents();
- void SetParentClassNameAllocated() { ParentClassNameAllocated = TRUE; }
-
- private:
- int ParentClassNameAllocated;
- CRuntimeClass m_Class;
- MODEL *m_Model;
- CVBCtlPropInfoList m_proplist;
- CVBCtlEventInfoList m_eventlist;
- };
-
- class CVBCtlModelList : public CObList {
- };
-
- //
- // Class CVBDLL - The vbx dll application object.
- //
- class CVBDLL : public CWinApp
- {
- public:
- //
- // Construction / Destruction.
- //
-
- CVBDLL();
-
- ~CVBDLL();
-
- //
- // Model, Property, and Event Methods
- //
-
- void AddModel(char *CtlName, FLONG fl, FSHORT fsClassStyle,
- FLONG flWndStyle, USHORT cbCtlExtra, USHORT idBmpPalette,
- PSTR npszParentClassName = NULL,
- BYTE nDefProp = -1, BYTE nDefEvent = -1, BYTE nValueProp = -1,
- CRuntimeClass *theclass = NULL);
-
- void AddModel(char *CtlName, FLONG fl, FSHORT fsClassStyle,
- FLONG flWndStyle, USHORT cbCtlExtra, USHORT idBmpPalette,
- CRuntimeClass *theclass = NULL);
-
- void SetParentWindowClass(char *CtlName, char *ParentWindowClass = NULL);
- void SetDefProp(char *CtlName, BYTE nDefProp = -1, BYTE nValueProp = -1);
- void SetDefEvent(char *CtlName, BYTE nDefEvent = -1);
-
- char *GetParentWindowClass(char *CtlName);
- BYTE GetDefProp(char *CtlName);
- BYTE GetDefEvent(char *CtlName);
-
- void AddProperty(char *CtlName, PROPINFO NEAR *StdProp );
-
- void AddProperty(char *CtlName, PSTR npszName, FLONG fl,
- BYTE offsetData, LONG dataDefault = -1, PSTR npszEnumList = NULL,
- BYTE enumMax = -1);
-
- void AddEvent(char *CtlName, EVENTINFO NEAR *StdEvent );
-
- void AddEvent(char *CtlName, PSTR npszName, USHORT cParms = 0,
- USHORT cwParms = 0, PWORD npParmTypes = NULL,
- PSTR npszParmProf = NULL, FLONG fl = 0L);
-
- //
- // Methods for popup window creation control.
- //
-
- int IsPopupWnd() { return m_PopupWndStat; }
- void SetPopupWnd(BOOL val) { m_PopupWndStat = val; }
-
- //
- // Private Data Access Methods
- //
-
- CVBCtlModel *GetFirst();
- CVBCtlModel *GetNext();
- CVBCtlModel *FindModel( char *CtlName );
-
- CRuntimeClass *GetCtlClass(MODEL FAR *lpmodel);
-
- //
- // Initialization Methods.
- //
-
- int InitInstance();
- int ExitInstance();
-
- private:
- CVBCtlModelList m_ModelList;
- int m_PopupWndStat;
- POSITION pos;
- };
-
- #endif // __MFCVBX_H__
-
-
-
-
-